<?php
/**
 * User: Administrator
 * Email: aphie1900@sina.com
 * Date & Time: 2017/9/15 0015 16:03
 */

namespace app\api\controller\v1;

use app\api\model\Category as CategoryModel;
use app\lib\exception\CategoryException;


class Category
{
    public function getAllCategories()
    {
        $categories = CategoryModel::getAll();
        if($categories->isEmpty()){
            throw new CategoryException();
        }
        return $categories;
    }

}